package com.renting.modules.renting.share.service;

import com.renting.modules.renting.share.dao.ShareItemDao;
import com.renting.modules.renting.share.entity.ShareItem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class ShareItemService {

    @Autowired
    ShareItemDao shareItemDao;

    public String findById(String id) {
        Optional<ShareItem> optional = shareItemDao.findById(id);
        if(optional!= null&&optional.isPresent()){
            return optional.get().toJsonString();
        }
        return null;
    }


}
